unit uRelContaContabil2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uRelatorio, RLPDFFilter, RLXLSFilter, RLFilters, RLHTMLFilter,
  RLDraftFilter, RLReport, DB;

type
  TFRelContaContabil2 = class(TfRelatorio)
    RLBand2: TRLBand;
    RLLabel1: TRLLabel;
    RLLabel2: TRLLabel;
    RLBand3: TRLBand;
    RLDBText2: TRLDBText;
    RLDBText3: TRLDBText;
    RLLabel3: TRLLabel;
    RLDBText4: TRLDBText;
    RLLabel4: TRLLabel;
    RLDBText5: TRLDBText;
    procedure RLBand3BeforePrint(Sender: TObject; var PrintIt: Boolean);
    procedure RLDBText4BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FRelContaContabil2: TFRelContaContabil2;

implementation

uses uCadastroContaContabil;

{$R *.dfm}

procedure TFRelContaContabil2.RLBand3BeforePrint(Sender: TObject;
  var PrintIt: Boolean);
begin
  inherited;
  if DataSource.DataSet.FieldByName('CCON_CODPAI').IsNull then
  begin
    RLReport.NewPage;
  end;
end;

procedure TFRelContaContabil2.RLDBText4BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
  inherited;
  if Text = 'C' then
    Text := 'Credora'
  else
    Text := 'Devedora';
end;

end.
